package com.srs.backend.pojo;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.Date;

@Data
@NoArgsConstructor
@AllArgsConstructor
public class OrderItem {
    @TableId(type = IdType.AUTO)
    private Integer id;
    private Integer orderId;
    private Integer foodId;
    private transient String foodName;
    private Integer chefId;
    private String remark;
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "Asia/Shanghai")
    private Date createTime;
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "Asia/Shanghai")
    private Date finishTime;

    public OrderItem (Integer id,
                      Integer orderId,
                      Integer foodId,
                      Integer chefId,
                      String remark,
                      Date createTime,
                      Date finishTime) {
        this.id = id;
        this.orderId = orderId;
        this.foodId = foodId;
        this.chefId = chefId;
        this.remark = remark;
        this.createTime = createTime;
        this.finishTime = finishTime;
    }
}
